<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:80:"D:\PHPTutorial\WWW\project\public/../application/admin\view\phone\phoneCard.html";i:1541646847;s:66:"D:\PHPTutorial\WWW\project\application\admin\view\common\head.html";i:1541553784;s:68:"D:\PHPTutorial\WWW\project\application\admin\view\common\footer.html";i:1515220428;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>上海顾云数据科技中心</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/build/css/app.css" media="all">
</head>
<style>
    .hidden{
        display: none;
    }

</style>

<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 2rem;">
  <blockquote class="layui-elem-quote"><span>身份证实名认证&nbsp;&nbsp;&nbsp;&nbsp;接口测试</span></blockquote>
  <div class="demoTable layui-form">
    <div style="margin-bottom: 0.5em"><b>接口地址:</b></div>
    <input type="text" placeholder="http://japi.juhe.cn/enterprise/simpleList" name="admin_name" class="layui-input" disabled="">
  </div>
  <div class="demoTable layui-form" style="margin-top: 0.5em">
    <div style="margin-bottom: 0.5em"><b>请求方式:</b></div>
    <input type="text" placeholder="GET" name="admin_name" class="layui-input" disabled="">
  </div>
  <div class="layui-form" style="margin-top: 0.5em">
    <div style="margin-bottom: 0.5em"><b>请求参数:</b></div>
    <table class="layui-table">
      <colgroup>
        <col width="150">
        <col width="150">
        <col width="200">
        <col>
      </colgroup>
      <thead>
        <tr>
          <th>参数名</th>
          <th>类型</th>
          <th>是否必填</th>
          <th>说明</th>
          <th>值</th>
        </tr> 
      </thead>
      <tbody>
         <td>appKey</td>
          <td>string</td>
          <td>是</td>
          <td>身份标识</td>
          <td>
            <div class="demoTable layui-form">
              <div class="layui-input-inline">
                  <input type="text" placeholder="" class="layui-input appKey">
              </div>
            </div>
          </td>
        </tr>
        <tr>
          <td>idcard</td>
          <td>string</td>
          <td>是</td>
          <td>身份证号码</td>
          <td>
            <div class="demoTable layui-form">
              <div class="layui-input-inline">
                  <input type="text" placeholder="" class="layui-input idcard">
              </div>
            </div>
          </td>
        </tr>
        <tr>
          <td>realname</td>
          <td>string</td>
          <td>是</td>
          <td>姓名(需要utf8编码的urlencode)</td>
          <td>
            <div class="demoTable layui-form">
              <div class="layui-input-inline">
                  <input type="text" placeholder="" class="layui-input realname">
              </div>
            </div>
          </td>
        </tr>
        <tr>
          <td>key</td>
          <td>string</td>
          <td>是</td>
          <td>接口key值</td>
          <td>
            <span class="key">2ce56dc4f7145223f6e192d14e564efb</span>
          </td>
        </tr>
        <tr>
          <td>urltype</td>
          <td>int</td>
          <td>是</td>
          <td>接口类型</td>
          <td>
            <div class="demoTable layui-form">
              <div class="layui-input-inline">
                  <input type="text" placeholder="该参数为固定值:2" name="urltype" class="layui-input" disabled="">
                  <input type="hidden" class="urltype" placeholder="2">
              </div>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <div class="layui-form" style="margin-top: 1.5em">
    <button class="layui-btn search" data-type="reload">发送请求</button>
    <span style="color: #FF940B;margin-left: 0.5em">(*为了准确性,所有请求均基于真实环境请求，请悉知)</span>
  </div>
  <div class="layui-form" style="margin-top: 1.2em">
    <div style="margin-bottom: 0.5em"><b>返回内容:</b></div>
    <div style="padding: 20px; background-color: #F2F2F2;">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
          <div class="layui-card">
            <div class="layui-card-body">
              <pre class='response'></pre>
            </div>
          </div>
        </div>
      </div>
    </div> 
  </div>
</div>
    <script src="/static/admin/layui/layui.js"></script>
<script src="/static/common/js/jquery.min.js"></script>
<script>
//    图片放大显示
    $('.select_img').on('click',function () {
        var img_url=$(this).data('content');
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            area: ['50%','80%'],
            skin: 'layui-layer-nobg', //没有背景色
            shadeClose: true,
            content: '<img src="'+img_url+'" />',
        });
    })
    //文件上传
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;
        //多文件列表示例
        var demoListView = $('#demoList')
            ,uploadListIns = upload.render({
            elem: '#testList'
            ,url: '<?php echo url("Upload/file_images"); ?>'
            ,accept: 'file'
            ,multiple: true
            ,auto: false
            ,bindAction: '#testListAction'
            ,choose: function(obj){
                var files = obj.pushFile(); //将每次选择的文件追加到文件队列
                //读取本地文件
                obj.preview(function(index, file, result){
                    var tr = $(['<tr id="upload-'+ index +'">'
                        ,'<td>'+ file.name +'</td>'
                        ,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
                        ,'<td>等待上传</td>'
                        ,'<td>'
                        ,'<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
                        ,'<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete">删除</button>'
                        ,'</td>'
                        ,'</tr>'].join(''));

                    //单个重传
                    tr.find('.demo-reload').on('click', function(){
                        obj.upload(index, file);
                    });

                    //删除
                    tr.find('.demo-delete').on('click', function(){
                        delete files[index]; //删除对应的文件
                        tr.remove();
                    });

                    demoListView.append(tr);
                });
            }
            ,done: function(res, index, upload){
                if(res.code == 200){ //上传成功
                    var tr = demoListView.find('tr#upload-'+ index)
                        ,tds = tr.children();
                    tds.eq(2).html('<span style="color: #5FB878;">上传成功</span><input type="hidden" name="images['+index+']" value="'+res.data.src+'">');
                    tds.eq(3).html(''); //清空操作
                    delete files[index]; //删除文件队列已经上传成功的文件
                    return;
                }
                this.error(index, upload);
            }
            ,error: function(index, upload){
                var tr = demoListView.find('tr#upload-'+ index)
                    ,tds = tr.children();
                tds.eq(2).html('<span style="color: #FF5722;">上传失败</span>');
                tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
            }
        });

        //普通图片上传 单图片上传
        var uploadInst = upload.render({
            elem: '#image'
            ,url: '<?php echo url("Upload/file_images"); ?>'
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#show_image').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                if(res.code == 400){
                    return layer.msg('上传失败');
                }
                $('.value_image').val(res.data.src);
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
</script>

<script src="/static/admin/jquery.js"></script>
<script type="text/javascript">

        function syntaxHighlight(json) {

            if (typeof json != 'string') {

                json = JSON.stringify(json, undefined, 2);

            }

            json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');

            return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function(match) {

                var cls = 'number';

                if (/^"/.test(match)) {

                    if (/:$/.test(match)) {

                        cls = 'key';

                    } else {

                     cls = 'string';

                    }

                } else if (/true|false/.test(match)) {

                    cls = 'boolean';

                } else if (/null/.test(match)) {

                    cls = 'null'; 

                }

                return '<span class="' + cls + '">' + match + '</span>';

            });

        }

    </script>
<script>
  $('.search').click(function(){
    var appKey = $('.appKey').val()
    var realname = $('.realname').val()
    var idcard = $('.idcard').val()
    var urltype = $('.urltype').attr('placeholder')
    var key = $('.key').text()
    $.ajax({
      url: '/admin/Phone/phoneList',
      dataType: 'json',
      type: 'post',
      // async:false,
      data: {'appKey':appKey,'realname': realname, 'urltype': urltype,'idcard':idcard,'key':key},
      success: function (data){
          $('.response').html(syntaxHighlight(data));
      }
    });
  });
</script>
</body>
</html>